<?php


class Category extends CI_Controller {

	function index()
	{
		echo 'Hello World!';
		$this->load->model('label');
		$data['labelArray'] = $this->label->get_last_ten_entries();
		$data['title'] = "Restaurant Home Page";
		$this->load->view('restaurant/restaurantHome', $data);
		//print_r($data['labelArray']);
	}
	
	function addNewCategory($name,$restaurantId)
	{
		echo 'Start add a new category <br/>';
		$name = isset($name)?$name:"炒饭";
		$restaurantId = isset($restaurantId)?$restaurantId:2;
		$date['name'] = $name; 
		$date['restaurantId'] = $restaurantId; 
        $this->load->model('categoryModel');
        $this->categoryModel->insert_entry($date);
        echo $name.' <br/>';
        echo $restaurantId.'<br/>';
		echo 'End add a new category <br/>';
	}
}